import 'package:boss/textStyle/text_style.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class OrderHeaderBar extends StatelessWidget {
  final String title;
  final TextStyle titleStyle;
  final int orderCount;
  final int price;

  const OrderHeaderBar({
    Key key,
    @required this.title,
    this.titleStyle,
    @required this.orderCount,
    @required this.price,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 60.w,
      padding: EdgeInsets.only(
        left: 30.w,
        right: 30.w,
        bottom: 8.w,
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        crossAxisAlignment: CrossAxisAlignment.end,
        children: <Widget>[
          Text(
            title,
            style: titleStyle ?? TextStyleConstant().normal_1_36,
          ),
          RichText(
            text: TextSpan(text: '合计：', style: TextStyleConstant().normal_3_28, children: [
              TextSpan(
                text: '$orderCount单  ¥${AmountUtil.price2String(price)}',
                style: TextStyleConstant().normal_1_28,
              ),
            ]),
          ),
        ],
      ),
    );
  }
}
